﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZPod.MTG.Windows
{
	public partial class PlayerDialog : Form
	{
		#region Public Constructors 

		public PlayerDialog()
		{
			InitializeComponent();
			playerView.StateChanged += new EventHandler(playerView_StateChanged);
		}

		#endregion

		#region Events

		public event EventHandler StateChanged;

		#endregion

		#region Public Properties


		public PlayerState State
		{
			get
			{
				return playerView.State;
			}
			set
			{
				using (var freezer = new FormFreezer(this, false))
				{
					playerView.State = value;
				}
			}
		}

		public Deck Deck
		{
			get
			{
				return playerView.Deck;
			}
			set
			{
				playerView.Deck = value;
			}
		}

		public bool CanControl
		{
			get
			{
				return playerView.CanControl;
			}

			set
			{
				playerView.CanControl = value;
			}
		}


		#endregion 

		#region Private Methods

		void playerView_StateChanged(object sender, EventArgs e)
		{
			if (StateChanged != null)
			{
				StateChanged(this, EventArgs.Empty);
			}
		}

		#endregion
	}
}
